package com.csun.cmny.provider.device.sleepcare.entity.param;

import com.csun.cmny.provider.utils.TimeUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.GregorianCalendar;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-02-22 15:45
 * @Description: the class sleep care body motion param
 */
@Data
public class SleepCareBodyMotionParam implements Serializable {

    private static final long serialVersionUID = -1191340411434151211L;

    /**
     * 床垫编号
     */
    private String materialId;

    /**
     * 日期
     *
     * @format yyyy-MM-dd
     */
    private String date;

    public SleepCareBodyMotionParam(String materialId) {

        this.materialId = materialId;
        if (new GregorianCalendar().get(GregorianCalendar.AM_PM) == 1) {
            this.date = TimeUtils.getToday();
        } else {
            this.date = TimeUtils.getYestoday();
        }
    }

}
